using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace BeerScanatronClient.Entities
{
    [DataContract]
    [Table("DispenserInfo")]
    public partial class DispenserInfo
    {
        public DispenserInfo()
        { }

        public DispenserInfo(Drinker drinker, Beer beer)
        {
            this.BeerID = beer.Id;
            this.DrinkerID = drinker.Id;
            ServeDate = DateTime.Now;
        }

        [DataMember]
        [Key]
        public int Id { get; private set; }

        [DataMember]
        [Required]
        public int DrinkerID { get; private set; }

        [DataMember]
        [Required]
        public int BeerID { get; private set; }

        [DataMember]
        [Required]
        [Index("DispenserInfoServerDateIndex", IsClustered = false)]
        public DateTime ServeDate { get; private set; }
    }
}